<?php
namespace ImiApp\Module\Member\Service\Base;

use Imi\Model\Model;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Table;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\Entity;

/**
 * 管理员表 基类
 * @Entity
 * @Table(name="sc_admin", id={"id"})
 * @DDL("CREATE TABLE `sc_admin` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `username` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '用户名',
  `nickname` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '昵称',
  `password` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '密码',
  `salt` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '密码盐',
  `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '头像',
  `email` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '电子邮箱',
  `loginfailure` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '失败次数',
  `logintime` int(10) DEFAULT NULL COMMENT '登录时间',
  `loginip` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '登录IP',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  `token` varchar(59) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT 'Session标识',
  `group` int(5) unsigned DEFAULT NULL COMMENT '组',
  `status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal' COMMENT '状态',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `username` (`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT COMMENT='管理员表'")
 * @property int $id ID
 * @property string $username 用户名
 * @property string $nickname 昵称
 * @property string $password 密码
 * @property string $salt 密码盐
 * @property string $avatar 头像
 * @property string $email 电子邮箱
 * @property int $loginfailure 失败次数
 * @property int $logintime 登录时间
 * @property string $loginip 登录IP
 * @property int $createtime 创建时间
 * @property int $updatetime 更新时间
 * @property string $token Session标识
 * @property int $group 组
 * @property string $status 状态
 */
abstract class ScAdminBase extends Model
{
    /**
     * ID
     * id
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true)
     * @var int
     */
    protected $id;

    /**
     * 获取 id - ID
     *
     * @return int
     */ 
    public function getId()
    {
        return $this->id;
    }

    /**
     * 赋值 id - ID
     * @param int $id id
     * @return static
     */ 
    public function setId($id)
    {
        $this->id = $id;
        return $this;
    }

    /**
     * 用户名
     * username
     * @Column(name="username", type="varchar", length=20, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $username;

    /**
     * 获取 username - 用户名
     *
     * @return string
     */ 
    public function getUsername()
    {
        return $this->username;
    }

    /**
     * 赋值 username - 用户名
     * @param string $username username
     * @return static
     */ 
    public function setUsername($username)
    {
        $this->username = $username;
        return $this;
    }

    /**
     * 昵称
     * nickname
     * @Column(name="nickname", type="varchar", length=50, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $nickname;

    /**
     * 获取 nickname - 昵称
     *
     * @return string
     */ 
    public function getNickname()
    {
        return $this->nickname;
    }

    /**
     * 赋值 nickname - 昵称
     * @param string $nickname nickname
     * @return static
     */ 
    public function setNickname($nickname)
    {
        $this->nickname = $nickname;
        return $this;
    }

    /**
     * 密码
     * password
     * @Column(name="password", type="varchar", length=32, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $password;

    /**
     * 获取 password - 密码
     *
     * @return string
     */ 
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * 赋值 password - 密码
     * @param string $password password
     * @return static
     */ 
    public function setPassword($password)
    {
        $this->password = $password;
        return $this;
    }

    /**
     * 密码盐
     * salt
     * @Column(name="salt", type="varchar", length=30, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $salt;

    /**
     * 获取 salt - 密码盐
     *
     * @return string
     */ 
    public function getSalt()
    {
        return $this->salt;
    }

    /**
     * 赋值 salt - 密码盐
     * @param string $salt salt
     * @return static
     */ 
    public function setSalt($salt)
    {
        $this->salt = $salt;
        return $this;
    }

    /**
     * 头像
     * avatar
     * @Column(name="avatar", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $avatar;

    /**
     * 获取 avatar - 头像
     *
     * @return string
     */ 
    public function getAvatar()
    {
        return $this->avatar;
    }

    /**
     * 赋值 avatar - 头像
     * @param string $avatar avatar
     * @return static
     */ 
    public function setAvatar($avatar)
    {
        $this->avatar = $avatar;
        return $this;
    }

    /**
     * 电子邮箱
     * email
     * @Column(name="email", type="varchar", length=100, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $email;

    /**
     * 获取 email - 电子邮箱
     *
     * @return string
     */ 
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * 赋值 email - 电子邮箱
     * @param string $email email
     * @return static
     */ 
    public function setEmail($email)
    {
        $this->email = $email;
        return $this;
    }

    /**
     * 失败次数
     * loginfailure
     * @Column(name="loginfailure", type="tinyint", length=1, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $loginfailure;

    /**
     * 获取 loginfailure - 失败次数
     *
     * @return int
     */ 
    public function getLoginfailure()
    {
        return $this->loginfailure;
    }

    /**
     * 赋值 loginfailure - 失败次数
     * @param int $loginfailure loginfailure
     * @return static
     */ 
    public function setLoginfailure($loginfailure)
    {
        $this->loginfailure = $loginfailure;
        return $this;
    }

    /**
     * 登录时间
     * logintime
     * @Column(name="logintime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $logintime;

    /**
     * 获取 logintime - 登录时间
     *
     * @return int
     */ 
    public function getLogintime()
    {
        return $this->logintime;
    }

    /**
     * 赋值 logintime - 登录时间
     * @param int $logintime logintime
     * @return static
     */ 
    public function setLogintime($logintime)
    {
        $this->logintime = $logintime;
        return $this;
    }

    /**
     * 登录IP
     * loginip
     * @Column(name="loginip", type="varchar", length=50, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $loginip;

    /**
     * 获取 loginip - 登录IP
     *
     * @return string
     */ 
    public function getLoginip()
    {
        return $this->loginip;
    }

    /**
     * 赋值 loginip - 登录IP
     * @param string $loginip loginip
     * @return static
     */ 
    public function setLoginip($loginip)
    {
        $this->loginip = $loginip;
        return $this;
    }

    /**
     * 创建时间
     * createtime
     * @Column(name="createtime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $createtime;

    /**
     * 获取 createtime - 创建时间
     *
     * @return int
     */ 
    public function getCreatetime()
    {
        return $this->createtime;
    }

    /**
     * 赋值 createtime - 创建时间
     * @param int $createtime createtime
     * @return static
     */ 
    public function setCreatetime($createtime)
    {
        $this->createtime = $createtime;
        return $this;
    }

    /**
     * 更新时间
     * updatetime
     * @Column(name="updatetime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $updatetime;

    /**
     * 获取 updatetime - 更新时间
     *
     * @return int
     */ 
    public function getUpdatetime()
    {
        return $this->updatetime;
    }

    /**
     * 赋值 updatetime - 更新时间
     * @param int $updatetime updatetime
     * @return static
     */ 
    public function setUpdatetime($updatetime)
    {
        $this->updatetime = $updatetime;
        return $this;
    }

    /**
     * Session标识
     * token
     * @Column(name="token", type="varchar", length=59, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $token;

    /**
     * 获取 token - Session标识
     *
     * @return string
     */ 
    public function getToken()
    {
        return $this->token;
    }

    /**
     * 赋值 token - Session标识
     * @param string $token token
     * @return static
     */ 
    public function setToken($token)
    {
        $this->token = $token;
        return $this;
    }

    /**
     * 组
     * group
     * @Column(name="group", type="int", length=5, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $group;

    /**
     * 获取 group - 组
     *
     * @return int
     */ 
    public function getGroup()
    {
        return $this->group;
    }

    /**
     * 赋值 group - 组
     * @param int $group group
     * @return static
     */ 
    public function setGroup($group)
    {
        $this->group = $group;
        return $this;
    }

    /**
     * 状态
     * status
     * @Column(name="status", type="varchar", length=30, accuracy=0, nullable=false, default="normal", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $status;

    /**
     * 获取 status - 状态
     *
     * @return string
     */ 
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * 赋值 status - 状态
     * @param string $status status
     * @return static
     */ 
    public function setStatus($status)
    {
        $this->status = $status;
        return $this;
    }

}
